
Page({
    data: {
        windowHeight:0,//屏幕高度
        statusBarHeight: 0,//状态栏
        navBarHeight: 0,//导航栏
        statusBarHeightmargintop: 0,//胶囊上边距
        safeHeight: 0,//安全区域，内容区域 + 导航栏
        bottomSafeHeight: 0,

      },

      onLoad() {
        // 获取系统顶部数值
        const windowInfo = wx.getWindowInfo();
        const menuButtonInfo = wx.getMenuButtonBoundingClientRect();
        let windowHeight = windowInfo.screenHeight;
        let statusBarHeight = windowInfo.statusBarHeight;
        let navBarHeight =
          menuButtonInfo.height + (menuButtonInfo.top - statusBarHeight) * 2;
        let statusBarHeightmargintop =
          menuButtonInfo.top - statusBarHeight;
        let safeHeight = windowInfo.safeArea.height;
        let bottomSafeHeight =
          windowInfo.screenHeight - windowInfo.safeArea.height - statusBarHeight;
        this.setData({
          windowHeight,
          statusBarHeight,
          navBarHeight,
          statusBarHeightmargintop,
          safeHeight,
          bottomSafeHeight,
        });

      },

})
